<script setup lang="ts">
import { onMounted, ref } from "vue-demi";
import { getRecNewMusic } from "@/api/content";
import MusicItem from "@/components/MusicItem/index.vue";

const list = ref<any[]>([]);

onMounted(async () => {
  const res = await getRecNewMusic();
  list.value = res.result.map((t: any) => ({
    ...t,
    sq: t.song.sqMusic,
    ar: t.song.artists,
    alName: t.song.album.name,
  }));
});
</script>

<template>
  <h2 class="rec-title">最新音乐</h2>
  <MusicItem :list="list"></MusicItem>
</template>

<style lang="scss" scoped></style>
